﻿<%@ Page Title="" Language="VB" MasterPageFile="~/App/Master/App.master" AutoEventWireup="false" CodeFile="Categorize.aspx.vb" Inherits="App_Categorize" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CphHead" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CphMainContent" runat="Server">
    <asp:ScriptManagerProxy runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/js/jquery/js/jquery.jstree.js" />
            <asp:ScriptReference Path="Categorize.aspx.js" />
        </Scripts>
    </asp:ScriptManagerProxy>

    <script type="text/javascript">

        var tree_type_id = <% = Me.Items("tree_type_id")%>;
        var root_folder_id = <% = Me.Items("RootFolderID")%>;
        var webservice_url = '<% = Me.ResolveClientUrl("~/Webservice/Folder.asmx/") %>';
        var icons_path = '<% = Me.ResolveClientUrl("~/style/App/img/Icons/")%>';

    </script>
    <asp:Panel runat="server" DefaultButton="Btncerca">

        <div class="row">

            <div class="span4">
                <div class="wrapper">
                    <h5 class="title titolo-cassetto">Folder                    </h5>
                    <div class="wrapper-inner">
                        <div>
                            <input type="button" id="add_folder" value="ADD" style="" />
                            <input type="button" id="rename_folder" value="RENAME" style="" />
                            <input type="button" id="remove_folder" value="REMOVE" style="" />
                        </div>
                        <div id="demo1" style="height: 400px; overflow: auto;">
                        </div>
                    </div>
                </div>
            </div>
            <div class="span4">
                <div class="wrapper">
                    <h5 class="title  titolo-cassetto">Category</h5>
                    <div class="wrapper-inner">
                        <asp:UpdatePanel ID="UpPElaborations" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <asp:Button ID="BtnReload_UpPElaborations" runat="server" Style="display: none;" Text="Reload" />
                                <asp:HiddenField ID="HidSelectFolderId" runat="server" Value="0" />
                                <div id="Grid_check" style="height: 400px; overflow: auto;">
                                    <asp:GridView ID="GridElaborations" runat="server" Width="100%" AutoGenerateColumns="False" CssClass="summary-results" ShowHeader="true" AllowSorting="true" AllowPaging="True">
                                        <Columns>
                                            <asp:TemplateField HeaderText="" HeaderStyle-Width="10px">
                                                <HeaderTemplate>
                                                    <input id="ChkAllElab" type="checkbox" value="" />
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <span id='<%# Eval("id") %>' data-type='<%# mDB.Folder.DataType.CATEGORIZE %>' class="jstree-draggable" onmousedown="onmousedown_chk_elab($(this));" onmouseup="onmouseup_chk_elab($(this));" onclick="return false;">
                                                        <asp:CheckBox runat="server" ID="ChkElab" />
                                                    </span>
                                                </ItemTemplate>
                                                <ItemStyle HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="" HeaderStyle-Width="20px" ItemStyle-HorizontalAlign="Center">
                                                <ItemTemplate>
                                                    <div style="">
                                                        <asp:ImageButton runat="server" Width="20" ToolTip="seleziona la ricerca" CommandName="LOAD" ImageUrl="~/style/App/img/icons/check.png"></asp:ImageButton>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Categoria" HeaderStyle-Width="">
                                                <ItemStyle HorizontalAlign="Left" />
                                                <ItemTemplate>
                                                    <div style="font-size: 11px; font-weight: bold;">
                                                        <asp:Label runat="server" Text='<%# Eval("description") %>'></asp:Label>
                                                    </div>
                                                    <div style="font-size: 11px;">
                                                        <asp:Label runat="server" Text='<%# Eval("query") %>'></asp:Label>
                                                    </div>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    description:
                                            <asp:TextBox runat="server" ID="TxtDescription" Width="97%" Text='<%# Eval("Description") %>'></asp:TextBox>
                                                    <br />
                                                    query:
                                            <asp:TextBox runat="server" ID="TxtQuery" Width="97%" Text='<%# Eval("query") %>' Rows="3" TextMode="MultiLine"></asp:TextBox>
                                                </EditItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="" HeaderStyle-Width="65" ItemStyle-HorizontalAlign="Right">
                                                <ItemTemplate>
                                                    <asp:ImageButton runat="server" ID="IbtFollow" Width="20" ToolTip="FOLLOW" CommandName="FOLLOW" ImageUrl="~/style/App/img/icons/list-add.png"></asp:ImageButton>
                                                    <asp:ImageButton runat="server" ToolTip="edit" Width="20" CommandName="EDIT_ROW" ImageUrl="~/style/App/img/icons/icon_edit.png"></asp:ImageButton>
                                                    <asp:ImageButton runat="server" ToolTip="delete" Width="20" CommandName="DELETE_ROW" ImageUrl="~/style/App/img/icons/delete.png"></asp:ImageButton>
                                                    <%-- <asp:ImageButton runat="server" Width="20" ToolTip="indicizza" CommandName="INDEX" ImageUrl="~/style/App/img/icons/list-add.png"></asp:ImageButton>--%>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <asp:ImageButton runat="server" ToolTip="cancel" Width="20" CommandName="CANCEL_ROW_EDIT" ImageUrl="~/style/App/img/icons/UndoButton.png"></asp:ImageButton>
                                                    <asp:ImageButton runat="server" ToolTip="update" Width="20" CommandName="UPDATE_ROW" ImageUrl="~/style/App/img/icons/save.png"></asp:ImageButton>
                                                </EditItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                        <AlternatingRowStyle CssClass="AlternatingRow Padding2" />
                                        <HeaderStyle CssClass="Header" />
                                        <RowStyle CssClass="Row Padding2" />
                                        <SelectedRowStyle CssClass="SelectedRow Padding2" />
                                        <EditRowStyle CssClass="EditRow Padding2" />
                                    </asp:GridView>
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>

                    </div>

                </div>
            </div>
            <div class="span4">
                <div class="wrapper">
                    <h5 class="title  titolo-cassetto">Analize</h5>
                    <div class="wrapper-inner">
                        <asp:UpdatePanel ID="UpPFollowQuery" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <asp:Button ID="BtnUpdateFollQuery" runat="server" Text="UPDATE" />
                                <asp:Button ID="BtnRemoveFollQuery" runat="server" Text="REMOVE ALL" />

                                <div style="height: 400px; overflow: auto;">
                                    <asp:GridView ID="GridFollowQuery" runat="server" Width="100%" AutoGenerateColumns="False" CssClass="summary-results" ShowHeader="true" AllowSorting="true" AllowPaging="True">
                                        <Columns>
                                            <asp:TemplateField HeaderText="" HeaderStyle-Width="40px" ItemStyle-HorizontalAlign="Center">
                                                <ItemTemplate>
                                                    <asp:ImageButton runat="server" ID="IbtUnFollow" Width="20" ToolTip="Elimina analisi" CommandName="UNFOLLOW" ImageUrl="~/style/App/img/icons/UndoButton.png"></asp:ImageButton>
                                                    <asp:ImageButton runat="server" Width="20" ToolTip="Effettua analisi" CommandName="CATEGORIZE" ImageUrl="~/style/App/img/icons/view-refresh.png"></asp:ImageButton>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="categoria" HeaderStyle-Width="">
                                                <ItemTemplate>
                                                    <asp:Label runat="server" Text='<%# eval("description") %>'></asp:Label>
                                                    (<asp:Label runat="server" Text='<%# eval("account_count") %>'></asp:Label>)
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="acc" HeaderStyle-Width="">
                                                <ItemTemplate>
                                                    <asp:TextBox runat="server" Text='<%# eval("accuracy_total_account") %>' ID="TxtAccuracyTotalAccount" Width="30px"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                        <AlternatingRowStyle CssClass="AlternatingRow Padding2" />
                                        <HeaderStyle CssClass="Header" />
                                        <EditRowStyle CssClass="EditRow" />
                                        <SelectedRowStyle CssClass="SelectedRow" />
                                        <RowStyle CssClass="Row Padding2" />
                                    </asp:GridView>
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>

                </div>
            </div>

        </div>

        <div class="row">

            <div class="span5">
                <div class="wrapper">
                    <h5 class="title titolo-cassetto">Folder
                    </h5>
                    <div class="wrapper-inner">
                        <asp:UpdatePanel ID="UpPtext" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                Descrizione:<br />
                                <asp:TextBox runat="server" ID="TxtDescription" Rows="5" Width="300" Text=""></asp:TextBox>
                                Testo:<br />
                                <asp:TextBox runat="server" ID="Txtpost" Rows="5" Width="300" TextMode="MultiLine" Text="#seo #sem #smo #backlinks #linkbuilding #searchengine #rankings #pagerank #ppc #google #bing"></asp:TextBox>
                                <br />
                                Accuracy minimo POST:
                <asp:TextBox runat="server" ID="TxtAcc" Text="70"></asp:TextBox>
                                <br />
                                Accuracy minimo USER:
                <asp:TextBox runat="server" ID="TxtAccUser" Text="1000"></asp:TextBox>
                                <br />
                            </ContentTemplate>
                        </asp:UpdatePanel>

                    </div>
                </div>
            </div>

            <div class="span3">
                <div class="wrapper">
                    <h5 class="title titolo-cassetto">Pesi</h5>
                    <div class="wrapper-inner" style="font-size: 10px; text-align: right;">
                        Word-word:
                        <asp:TextBox runat="server" ID="TxtWordWord" Text="100" Style="width: 30px;"></asp:TextBox>%<br />
                        Hashtag-Hashtag:
                        <asp:TextBox runat="server" ID="Txthashhash" Text="140" Style="width: 30px;"></asp:TextBox>%<br />
                        Word-Hashtag:
                        <asp:TextBox runat="server" ID="TxtWordhash" Text="120" Style="width: 30px;"></asp:TextBox>%<br />
                        Hashtag-Word:
                        <asp:TextBox runat="server" ID="TxthashWord" Text="80" Style="width: 30px;"></asp:TextBox>%<br />
                        Stemming:
                        <asp:TextBox runat="server" ID="Txtstemm" Text="70" Style="width: 30px;"></asp:TextBox>%<br />
                        Prox:
                        <asp:TextBox runat="server" ID="Txtprox" Text="30" Style="width: 30px;"></asp:TextBox>%<br />
                    </div>
                </div>
            </div>

            <div class="span4">
                <div class="wrapper">
                    <h5 class="title titolo-cassetto">Grafo</h5>
                    <div class="wrapper-inner">
                        <img src="/Style/App/Img/PesoRicerche.png" width="300" />
                    </div>
                </div>
            </div>
        </div>

        <asp:UpdatePanel ID="UpPCerca" runat="server" UpdateMode="Conditional">
            <ContentTemplate>

                <div class="row">

                    <div class="span8">
                        <div class="wrapper">
                            <h5 class="title titolo-cassetto">Analisys
                            </h5>
                            <div class="wrapper-inner">
                                <asp:Button runat="server" ID="Btncerca" Text="AVVIA ANALISI" Style="font-size: 18px; border: 3px solid #FF0000;" />
                                <asp:Button runat="server" ID="BtnSaveNew" Text="CREA NUOVA CATEGORIA" Style="font-size: 18px; border: 3px solid #FF0000;" />
                                <asp:Label runat="server" ID="LblMessCat" ViewStateMode="Disabled" Style="font-size: 13px; color: Red;" Text="" /><br />
                                <asp:Label runat="server" ID="LblUserFound" Text="" />
                            </div>
                        </div>
                    </div>


                    <%--            <div class="span5">
                <div class="wrapper">
                    <h5 class="title titolo-cassetto">Folder
                    </h5>
                    <div class="wrapper-inner">
                    </div>
                </div>
            </div>--%>

                    <div class="span4">
                        <div class="wrapper">
                            <h5 class="title titolo-cassetto">Response
                            </h5>
                            <div class="wrapper-inner">
                                <asp:Label runat="server" ID="LblExec" Text="" />

                            </div>
                        </div>
                    </div>

                </div>

                <div class="row" style="font-size: 12px;">

                    <div class="span4">
                        <div class="wrapper">
                            <h5 class="title">hashtag
                            </h5>
                            <div class="wrapper-inner">
                                <asp:Repeater runat="server" ID="RptHasttag">
                                    <ItemTemplate>
                                        <div class="tag_cloud_word">
                                            <asp:LinkButton runat="server" ID="LnkTag" ForeColor='' CommandArgument='<%# eval("key") %>' ToolTip='' Text='<%# eval("key") %>'></asp:LinkButton>
                                        </div>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </div>
                        </div>
                    </div>

                    <div class="span4">
                        <div class="wrapper">
                            <h5 class="title">word
                            </h5>
                            <div class="wrapper-inner">
                                <asp:Repeater runat="server" ID="RptWord">
                                    <ItemTemplate>
                                        <div class="tag_cloud_word">
                                            <asp:LinkButton runat="server" ID="LnkTag" ForeColor='' CommandArgument='<%# eval("key") %>' ToolTip='' Text='<%# eval("key") %>'></asp:LinkButton>
                                        </div>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </div>
                        </div>
                    </div>

                    <div class="span4">
                        <div class="wrapper">
                            <h5 class="title">Cluster2
                            </h5>
                            <div class="wrapper-inner">
                                <asp:Repeater runat="server" ID="RptCluster2">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="LblCluster" Text='<%# eval("key") %>'></asp:Label>
                                        (<asp:Label runat="server" Font-Bold="true" ForeColor="red" Text='<%# eval("value") %>'></asp:Label>)
                                    <br />
                                    </ItemTemplate>
                                </asp:Repeater>
                            </div>
                        </div>
                    </div>

                    <!--                    <div class="span2">
                        <div class="wrapper">
                            <h5 class="title">Cluster3
                            </h5>
                            <div class="wrapper-inner">
                                <asp:Repeater runat="server" ID="RptCluster3">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="LblCluster" Text='<%# eval("key") %>'></asp:Label>
                                        (<asp:Label runat="server" Font-Bold="true" ForeColor="red" Text='<%# eval("value") %>'></asp:Label>)
                                    <br />
                                        </span>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </div>
                        </div>
                    </div>-->

                </div>


                <div class="row">

                    <div class="span12">
                        <div class="wrapper">
                            <h5 class="title">users
                            </h5>
                            <div class="wrapper-inner">
                                <asp:GridView ID="GridUsers" runat="server" CssClass="summary-results" AutoGenerateColumns="False" AllowSorting="true" AllowPaging="True" Width="100%">
                                    <Columns>
                                        <%--                                <asp:TemplateField HeaderText="id" SortExpression="id">
                                    <ItemTemplate>
                                        <asp:Label runat="server" Text='<%# eval("id") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>--%>
                                        <asp:TemplateField HeaderText="Nome" SortExpression="fullname">
                                            <ItemTemplate>
                                                <asp:HyperLink runat="server" NavigateUrl='<%# "https://twitter.com/" & eval("username") %>' Target="_blank">
                                <asp:Label runat="server" Text='<%# eval("fullname") %>'></asp:Label>
                                                </asp:HyperLink>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="image">
                                            <ItemTemplate>
                                                <asp:HyperLink runat="server" NavigateUrl='<%# eval("url") %>' Target="_blank">
                                            <img src="<%# eval("avatar") %>" />
                                                </asp:HyperLink>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="description">
                                            <ItemTemplate>
                                                <asp:Label runat="server" Text='<%# eval("description") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="location">
                                            <ItemTemplate>
                                                <asp:Label runat="server" Text='<%# eval("location") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="follower" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label runat="server" Text='<%# ui.print.num0(eval("follower_count")) %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="post" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label runat="server" Text='<%# ui.print.num0(eval("Post_Count")) %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Accuracy" SortExpression="accuracy" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label Font-Bold="true" runat="server" Text='<%# ui.print.num0(eval("accuracy")) %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Post trovati" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label runat="server" Text='<%# ui.print.num0(eval("Post_total")) %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <AlternatingRowStyle CssClass="AlternatingRow Padding2" />
                                    <HeaderStyle CssClass="Header" />
                                    <SelectedRowStyle BackColor="LightGreen" />
                                    <RowStyle CssClass="Row Padding2" />
                                </asp:GridView>

                                <asp:GridView runat="server" ID="GridResults" CssClass="table_result" AutoGenerateColumns="false">
                                    <Columns>
                                        <asp:TemplateField HeaderText="Accuracy">
                                            <ItemTemplate>
                                                <asp:Label runat="server" ForeColor="Red" Font-Size="11px" Font-Bold="true" Text='<%# eval("Accuracy") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="id">
                                            <ItemTemplate>
                                                <asp:Label runat="server" Text='<%# eval("id") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Post_Text">
                                            <ItemTemplate>
                                                <asp:Label runat="server" Text='<%# eval("Post_Text") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="utente">
                                            <ItemTemplate>
                                                <asp:Label runat="server" Text='<%# eval("attribute0") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="data" HeaderStyle-Width="150px">
                                            <ItemTemplate>
                                                <asp:Label runat="server" Text='<%# utils.conv.totimestampdate( eval("attribute1")) %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <AlternatingRowStyle CssClass="AlternatingRow Padding2" />
                                    <HeaderStyle CssClass="Header" />
                                    <SelectedRowStyle BackColor="LightGreen" />
                                    <RowStyle CssClass="Row Padding2" />
                                </asp:GridView>

                            </div>
                        </div>
                    </div>
                </div>

            </ContentTemplate>
        </asp:UpdatePanel>

    </asp:Panel>
</asp:Content>
